<%@ page language="java" pageEncoding="UTF-8"
	errorPage="/ui/defaultException.jsp"%>
<%@include file="/ui/tags.jsp"%>
<div class=" trip-step4-info">
	<div class="trip-step4-info-title">
		<span class="title4">${trip.name }</span> 
		<span class="link4">
			<c:if test="${editor }">
				<a href="${cpath }/trip/${trip.tripId}/detail?from=true">行程明细 >></a>
			</c:if> 
			<c:if test="${!editor }">
				<a href="${cpath }/trip/${trip.tripId}/detail">行程明细 >></a>
			</c:if>
		</span>
	</div>
	<div class="trip-step4-info-show">
		<div class="trip-step4-info-show-img" img-resize="true">
			<img src="${image_domain }${trip.image}" />
		</div>
		<div class="trip-step4-info-show-d">
			<div class="details4">${trip.summary }</div>
			<div class="details5">
				<c:if test="${!empty trip.departureCity }">
					<span>出发城市： ${trip.departureCity }</span>
				</c:if>
				<c:if test="${!empty trip.departureDate }">
					<span>出发日期：<fmt:formatDate value="${trip.departureDate}" pattern="yyyy.MM.dd" /></span>
				</c:if>
				<span>旅行天数：${trip.days }</span>
				<c:if test="${trip.price > 0  }">
					<span class="price5">￥：<em>${trip.price }</em>/人</span>
				</c:if>
				<c:if test="${!empty  trip.bookUrl}">
					<span class="yd4"> <a href="${trip.bookUrl }" target="_blank">预定</a>
					</span>
				</c:if>
			</div>
		</div>
	</div>
	<c:if test="${!empty goFlight }">
		<div class="trip-step4-info-commend">
			<div class="trip-step4-info-commend-title">推荐航班</div>
			<div class="trip-step4-info-commend-air">
				<div class="l4">
					<span class="address4">${goFlight.departureCity }</span> 
					<span class="time4"><fmt:formatDate value="${goFlight.departureTime}" pattern="HH:mm" /></span> 
					<span class="date4"><fmt:formatDate value="${goFlight.departureTime}" pattern="yyyy.MM.dd" /></span> 
					<span class="airport4">${goFlight.departureAirport }</span>
				</div>
				<div class="m4">
					<span class="air4"> 
						<c:if test="${!empty goFlight.icon }">
							<img src="${image_domain }${goFlight.icon}" />
						</c:if> 
						${goFlight.airline }
					</span> 
					<span class="airtime4">飞行时长(<zen:interval to="${goFlight.arriveTime }" from="${goFlight.departureTime }" />)</span>
				</div>
				<div class="r4">
					<span class="address4">${goFlight.arriveCity }</span> 
					<span class="time4"><fmt:formatDate value="${goFlight.arriveTime}" pattern="HH:mm" /></span> 
					<span class="date4"><fmt:formatDate value="${goFlight.arriveTime}" pattern="yyyy.MM.dd" /></span> 
					<span class="airport4">${goFlight.arriveAirport }</span>
				</div>
			</div>
			<c:if test="${!empty backFlight}">
				<div class="trip-step4-info-commend-air">
					<div class="l4">
						<span class="address4">${backFlight.departureCity }</span> 
						<span class="time4"><fmt:formatDate value="${backFlight.departureTime}" pattern="HH:mm" /></span>
						<span class="date4"><fmt:formatDate value="${backFlight.departureTime}" pattern="yyyy.MM.dd" /></span>
						<span class="airport4">${backFlight.departureAirport }</span>
					</div>
					<div class="m4">
						<span class="air4"> <c:if test="${!empty backFlight.icon }">
								<img src="${image_domain }${backFlight.icon}" />
							</c:if> ${backFlight.airline }</span> <span class="airtime4">飞行时长(<zen:interval
								to="${backFlight.arriveTime }"
								from="${backFlight.departureTime }" />)</span>
					</div>
					<div class="r4">
						<span class="address4">${backFlight.arriveCity }</span> <span
							class="time4"><fmt:formatDate
								value="${backFlight.arriveTime}" pattern="HH:mm" />
						</span> <span class="date4"><fmt:formatDate
								value="${backFlight.arriveTime}" pattern="yyyy.MM.dd" />
						</span> <span class="airport4">${backFlight.arriveAirport }</span>
					</div>
				</div>
			</c:if>
		</div>
	</c:if>
	<c:if test="${!empty hotel1 }">
		<div class="trip-step4-info-commend2 ">
			<div class="trip-step4-info-commend2-title">推荐酒店</div>
			<div class="trip-step4-info-commend2-hotel">
				<div class="trip-step4-info-commend2-hotel-img">
					<img src="${image_domain }${hotel1.image}@!small" />
				</div>
				<div class="trip-step4-info-commend2-hotel-info">
					<span class="htitle4">${hotel1.locationName }</span> 
					<span class="hinfo4">${hotel1.summary }</span>
				</div>
			</div>
			<c:if test="${!empty hotel2 }">
				<div class="trip-step4-info-commend2-hotel">
					<div class="trip-step4-info-commend2-hotel-img">
						<img src="${image_domain }${hotel2.image}@!small" />
					</div>
					<div class="trip-step4-info-commend2-hotel-info">
						<span class="htitle4">${hotel2.locationName }</span> <span
							class="hinfo4">${hotel2.summary }</span>
					</div>
				</div>
			</c:if>
		</div>
	</c:if>
	<div class="clear1"></div>
</div>
<div class=" trip-step4-tripinfo">
	<c:forEach var="daily" items="${dailys }" varStatus="status">
		<div class=" trip-step4-tripinfo-day">
			<div class="trip-step4-tripinfo-day-title">
				<span>第${status.count }天</span> <span class="area4"> <c:forEach
						var="dest" items="${daily.tripdests}">
		  		${dest.name }&nbsp;&nbsp;
		  	</c:forEach> </span>
			</div>
			<div class="trip-step4-tripinfo-day-info">
				<c:choose>
					<c:when test="${!empty fn:trim(daily.content) }">${daily.content }</c:when>
					<c:otherwise>
						<c:forEach var="loc" items="${daily.tripDailyLocations }" varStatus="status">
							${status.count}.${loc.locationName }<br />
							<c:if test="${!empty loc.summary }">
								${loc.summary }<c:if test="${!status.last }"><br /></c:if>
							</c:if>
						</c:forEach>
					</c:otherwise>
				</c:choose>
			</div>
			<c:choose>
				<c:when
					test="${!empty daily.breakfast || !empty daily.lunch || !empty daily.supper || !empty daily.hotel}">
					<div class="trip-step4-tripinfo-day-c">
						<c:if test="${!empty daily.breakfast }">
							<span class="c4">早餐:${daily.breakfast }</span>
							<span class="s4">|</span>
						</c:if>
						<c:if test="${!empty daily.lunch }">
							<span class="c4">午餐:${daily.lunch }</span>
							<span class="s4">|</span>
						</c:if>
						<c:if test="${!empty daily.supper }">
							<span class="c4">晚餐:${daily.supper }</span>
						</c:if>
						<c:if test="${!empty daily.hotel }">
							<span class="h4">入住酒店:${daily.hotel }</span>
						</c:if>
					</div>
				</c:when>
				<c:otherwise>
					<div class="clear14px"></div>
				</c:otherwise>
			</c:choose>
			<c:if test="${fn:length(daily.tripDailyLocations) > 0 }">
				<div class="trip-step4-tripinfo-day-imgshow">
					<c:set var="imageCount" value="0" />
					<c:forEach var="loc" items="${daily.tripDailyLocations }"
						varStatus="status">
						<c:if test="${!empty loc.image && imageCount < 4}">
							<div class="trip-step4-tripinfo-day-imgshow-img" img-resize="true">
								
								<c:choose>
										<c:when test="${fn:contains(loc.image,'trip_traffic')}">
											<img src="${image_domain }${loc.image}" />
										</c:when>
										<c:otherwise>
											<img src="${image_domain }${loc.image}@!small" />
										</c:otherwise>
									</c:choose>
							</div>
							<c:set var="imageCount" value="${imageCount+1 }" />
						</c:if>
					</c:forEach>
					<c:if test="${imageCount <= 3 }">
						<c:forEach begin="1" end="${4 - imageCount }">
							<div class="trip-step4-tripinfo-day-imgshow-img"></div>
						</c:forEach>
					</c:if>
				</div>
			</c:if>
		</div>
	</c:forEach>
</div>

<script type="text/javascript">
    $(function () {
        $(".trip-step4-tripinfo-day-imgshow").each(function () {
            $(this).find(".trip-step4-tripinfo-day-imgshow-img").eq(0).css("margin-left", "0px");
        });
    })
</script>